<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE PatternSynonyms #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE UnboxedSums #-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-comment">-- | Compatibility module for pre ghc-bignum code.</span><span>
</span><span id="line-11"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Natural</span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier">Natural</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Natural.html#NatS%23"><span class="hs-identifier">NatS#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#NatJ%23"><span class="hs-identifier">NatJ#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.BigNat.html#BigNat"><span class="hs-identifier">B.BigNat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#mkNatural"><span class="hs-identifier">mkNatural</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#isValidNatural"><span class="hs-identifier">isValidNatural</span></a></span><span>
</span><span id="line-16"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Arithmetic</span></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#plusNatural"><span class="hs-identifier">plusNatural</span></a></span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#minusNatural"><span class="hs-identifier">minusNatural</span></a></span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#minusNaturalMaybe"><span class="hs-identifier">minusNaturalMaybe</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#timesNatural"><span class="hs-identifier">timesNatural</span></a></span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#negateNatural"><span class="hs-identifier">negateNatural</span></a></span><span>
</span><span id="line-22"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#signumNatural"><span class="hs-identifier">signumNatural</span></a></span><span>
</span><span id="line-23"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#quotRemNatural"><span class="hs-identifier">quotRemNatural</span></a></span><span>
</span><span id="line-24"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#quotNatural"><span class="hs-identifier">quotNatural</span></a></span><span>
</span><span id="line-25"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#remNatural"><span class="hs-identifier">remNatural</span></a></span><span>
</span><span id="line-26"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#gcdNatural"><span class="hs-identifier">gcdNatural</span></a></span><span>
</span><span id="line-27"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#lcmNatural"><span class="hs-identifier">lcmNatural</span></a></span><span>
</span><span id="line-28"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Bits</span></span><span>
</span><span id="line-29"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#andNatural"><span class="hs-identifier">andNatural</span></a></span><span>
</span><span id="line-30"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#orNatural"><span class="hs-identifier">orNatural</span></a></span><span>
</span><span id="line-31"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#xorNatural"><span class="hs-identifier">xorNatural</span></a></span><span>
</span><span id="line-32"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#bitNatural"><span class="hs-identifier">bitNatural</span></a></span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#testBitNatural"><span class="hs-identifier">testBitNatural</span></a></span><span>
</span><span id="line-34"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#popCountNatural"><span class="hs-identifier">popCountNatural</span></a></span><span>
</span><span id="line-35"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#shiftLNatural"><span class="hs-identifier">shiftLNatural</span></a></span><span>
</span><span id="line-36"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#shiftRNatural"><span class="hs-identifier">shiftRNatural</span></a></span><span>
</span><span id="line-37"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Conversions</span></span><span>
</span><span id="line-38"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#naturalToInteger"><span class="hs-identifier">naturalToInteger</span></a></span><span>
</span><span id="line-39"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#naturalToWord"><span class="hs-identifier">naturalToWord</span></a></span><span>
</span><span id="line-40"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#naturalToWordMaybe"><span class="hs-identifier">naturalToWordMaybe</span></a></span><span>
</span><span id="line-41"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#wordToNatural"><span class="hs-identifier">wordToNatural</span></a></span><span>
</span><span id="line-42"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#wordToNatural%23"><span class="hs-identifier">wordToNatural#</span></a></span><span>
</span><span id="line-43"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#naturalFromInteger"><span class="hs-identifier">naturalFromInteger</span></a></span><span>
</span><span id="line-44"></span><span>     </span><span class="annot"><span class="hs-comment">-- * Modular arithmetic</span></span><span>
</span><span id="line-45"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#powModNatural"><span class="hs-identifier">powModNatural</span></a></span><span>
</span><span id="line-46"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">where</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#"><span class="hs-identifier">GHC.Prim</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#"><span class="hs-identifier">GHC.Types</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Maybe.html"><span class="hs-identifier">GHC.Maybe</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#"><span class="hs-identifier">GHC.Num.Natural</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier">Natural</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#"><span class="hs-identifier">GHC.Num.Integer</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier">Integer</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.BigNat.html#"><span class="hs-identifier">GHC.Num.BigNat</span></a></span><span>  </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">B</span></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#"><span class="hs-identifier">GHC.Num.Natural</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">N</span></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#"><span class="hs-identifier">GHC.Num.Integer</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">I</span></span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-pragma">{-# COMPLETE</span><span> </span><span class="annot"><a href="GHC.Natural.html#NatS%23"><span class="hs-pragma hs-type">NatS#</span></a></span><span class="hs-pragma">,</span><span> </span><span class="annot"><a href="GHC.Natural.html#NatJ%23"><span class="hs-pragma hs-type">NatJ#</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">pattern</span><span> </span><span class="annot"><a href="GHC.Natural.html#NatS%23"><span class="hs-identifier hs-type">NatS#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Word%23"><span class="hs-identifier hs-type">Word#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">pattern</span><span> </span><span id="%24mNatS%23"><span id="%24bNatS%23"><span id="NatS%23"><span class="annot"><span class="annottext">$mNatS# :: forall {r}. Natural -&gt; (Word# -&gt; r) -&gt; (Void# -&gt; r) -&gt; r
$bNatS# :: Word# -&gt; Natural
</span><a href="GHC.Natural.html#%24mNatS%23"><span class="hs-identifier hs-var hs-var hs-var">NatS#</span></a></span></span></span></span><span> </span><span class="annot"><a href="#local-6989586621679480757"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#NS"><span class="hs-identifier hs-type">N.NS</span></a></span><span> </span><span id="local-6989586621679480757"><span class="annot"><a href="#local-6989586621679480757"><span class="hs-identifier hs-var">w</span></a></span></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-keyword">pattern</span><span> </span><span class="annot"><a href="GHC.Natural.html#NatJ%23"><span class="hs-identifier hs-type">NatJ#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.BigNat.html#BigNat"><span class="hs-identifier hs-type">B.BigNat</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">pattern</span><span> </span><span id="%24mNatJ%23"><span id="%24bNatJ%23"><span id="NatJ%23"><span class="annot"><span class="annottext">$mNatJ# :: forall {r}. Natural -&gt; (BigNat -&gt; r) -&gt; (Void# -&gt; r) -&gt; r
$bNatJ# :: BigNat -&gt; Natural
</span><a href="GHC.Natural.html#%24mNatJ%23"><span class="hs-identifier hs-var hs-var hs-var hs-var">NatJ#</span></a></span></span></span></span><span> </span><span class="annot"><a href="#local-6989586621679480754"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#NB"><span class="hs-identifier hs-type">N.NB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.BigNat.html#BN%23"><span class="hs-identifier hs-type">B.BN#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span id="local-6989586621679480754"><span class="annot"><a href="#local-6989586621679480754"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-66"></span><span>      </span><span class="annot"><a href="GHC.Natural.html#NatJ%23"><span class="hs-identifier hs-var">NatJ#</span></a></span><span> </span><span id="local-6989586621679480752"><span class="annot"><span class="annottext">BigNat
</span><a href="#local-6989586621679480752"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#NB"><span class="hs-identifier hs-var">N.NB</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BigNat -&gt; ByteArray#
</span><a href="../../ghc-bignum/src/GHC.Num.BigNat.html#unBigNat"><span class="hs-identifier hs-var hs-var">B.unBigNat</span></a></span><span> </span><span class="annot"><span class="annottext">BigNat
</span><a href="#local-6989586621679480752"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="annot"><a href="GHC.Natural.html#int2Word"><span class="hs-identifier hs-type">int2Word</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span>
</span><span id="line-69"></span><span id="int2Word"><span class="annot"><span class="annottext">int2Word :: Int -&gt; Word
</span><a href="GHC.Natural.html#int2Word"><span class="hs-identifier hs-var hs-var">int2Word</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679480749"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480749"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Word
</span><a href="../../ghc-prim/src/GHC.Types.html#W%23"><span class="hs-identifier hs-var">W#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="../../ghc-prim/src/GHC.Prim.html#int2Word%23"><span class="hs-identifier hs-var">int2Word#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480749"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="annot"><a href="GHC.Natural.html#word2Int"><span class="hs-identifier hs-type">word2Int</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-72"></span><span id="word2Int"><span class="annot"><span class="annottext">word2Int :: Word -&gt; Int
</span><a href="GHC.Natural.html#word2Int"><span class="hs-identifier hs-var hs-var">word2Int</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#W%23"><span class="hs-identifier hs-type">W#</span></a></span><span> </span><span id="local-6989586621679480747"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480747"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-var">I#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Int#
</span><a href="../../ghc-prim/src/GHC.Prim.html#word2Int%23"><span class="hs-identifier hs-var">word2Int#</span></a></span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480747"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-comment">-- | Construct 'Natural' value from list of 'Word's.</span><span>
</span><span id="line-75"></span><span class="annot"><a href="GHC.Natural.html#mkNatural"><span class="hs-identifier hs-type">mkNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-76"></span><span id="mkNatural"><span class="annot"><span class="annottext">mkNatural :: [Word] -&gt; Natural
</span><a href="GHC.Natural.html#mkNatural"><span class="hs-identifier hs-var hs-var">mkNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Word] -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalFromWordList"><span class="hs-identifier hs-var">N.naturalFromWordList</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">-- | Test whether all internal invariants are satisfied by 'Natural' value</span><span>
</span><span id="line-79"></span><span class="hs-comment">--</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- This operation is mostly useful for test-suites and/or code which</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- constructs 'Integer' values directly.</span><span>
</span><span id="line-82"></span><span class="hs-comment">--</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-84"></span><span class="annot"><a href="GHC.Natural.html#isValidNatural"><span class="hs-identifier hs-type">isValidNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-85"></span><span id="isValidNatural"><span class="annot"><span class="annottext">isValidNatural :: Natural -&gt; Bool
</span><a href="GHC.Natural.html#isValidNatural"><span class="hs-identifier hs-var hs-var">isValidNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Bool
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalCheck"><span class="hs-identifier hs-var">N.naturalCheck</span></a></span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- | 'Natural' Addition</span><span>
</span><span id="line-88"></span><span class="annot"><a href="GHC.Natural.html#plusNatural"><span class="hs-identifier hs-type">plusNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-89"></span><span id="plusNatural"><span class="annot"><span class="annottext">plusNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#plusNatural"><span class="hs-identifier hs-var hs-var">plusNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalAdd"><span class="hs-identifier hs-var">N.naturalAdd</span></a></span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-comment">-- | 'Natural' subtraction. May @'Control.Exception.throw'</span><span>
</span><span id="line-92"></span><span class="hs-comment">-- 'Control.Exception.Underflow'@.</span><span>
</span><span id="line-93"></span><span class="annot"><a href="GHC.Natural.html#minusNatural"><span class="hs-identifier hs-type">minusNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-94"></span><span id="minusNatural"><span class="annot"><span class="annottext">minusNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#minusNatural"><span class="hs-identifier hs-var hs-var">minusNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalSubThrow"><span class="hs-identifier hs-var">N.naturalSubThrow</span></a></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- | 'Natural' subtraction. Returns 'Nothing's for non-positive results.</span><span>
</span><span id="line-97"></span><span class="hs-comment">--</span><span>
</span><span id="line-98"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-99"></span><span class="annot"><a href="GHC.Natural.html#minusNaturalMaybe"><span class="hs-identifier hs-type">minusNaturalMaybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-100"></span><span id="minusNaturalMaybe"><span class="annot"><span class="annottext">minusNaturalMaybe :: Natural -&gt; Natural -&gt; Maybe Natural
</span><a href="GHC.Natural.html#minusNaturalMaybe"><span class="hs-identifier hs-var hs-var">minusNaturalMaybe</span></a></span></span><span> </span><span id="local-6989586621679480744"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480744"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679480743"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480743"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; (# Void# | Natural #)
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalSub"><span class="hs-identifier hs-var">N.naturalSub</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480744"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480743"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-101"></span><span>   </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">Void#
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">|</span><span>   </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Natural
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-102"></span><span>   </span><span class="hs-special">(#</span><span>       </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679480742"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480742"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Maybe Natural
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480742"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="hs-comment">-- | 'Natural' multiplication</span><span>
</span><span id="line-105"></span><span class="annot"><a href="GHC.Natural.html#timesNatural"><span class="hs-identifier hs-type">timesNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-106"></span><span id="timesNatural"><span class="annot"><span class="annottext">timesNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#timesNatural"><span class="hs-identifier hs-var hs-var">timesNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalMul"><span class="hs-identifier hs-var">N.naturalMul</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="annot"><a href="GHC.Natural.html#negateNatural"><span class="hs-identifier hs-type">negateNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-109"></span><span id="negateNatural"><span class="annot"><span class="annottext">negateNatural :: Natural -&gt; Natural
</span><a href="GHC.Natural.html#negateNatural"><span class="hs-identifier hs-var hs-var">negateNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalNegate"><span class="hs-identifier hs-var">N.naturalNegate</span></a></span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span class="annot"><a href="GHC.Natural.html#signumNatural"><span class="hs-identifier hs-type">signumNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-112"></span><span id="signumNatural"><span class="annot"><span class="annottext">signumNatural :: Natural -&gt; Natural
</span><a href="GHC.Natural.html#signumNatural"><span class="hs-identifier hs-var hs-var">signumNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalSignum"><span class="hs-identifier hs-var">N.naturalSignum</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="annot"><a href="GHC.Natural.html#quotRemNatural"><span class="hs-identifier hs-type">quotRemNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span id="quotRemNatural"><span class="annot"><span class="annottext">quotRemNatural :: Natural -&gt; Natural -&gt; (Natural, Natural)
</span><a href="GHC.Natural.html#quotRemNatural"><span class="hs-identifier hs-var hs-var">quotRemNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; (Natural, Natural)
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalQuotRem"><span class="hs-identifier hs-var">N.naturalQuotRem</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="GHC.Natural.html#remNatural"><span class="hs-identifier hs-type">remNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-118"></span><span id="remNatural"><span class="annot"><span class="annottext">remNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#remNatural"><span class="hs-identifier hs-var hs-var">remNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalRem"><span class="hs-identifier hs-var">N.naturalRem</span></a></span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="annot"><a href="GHC.Natural.html#quotNatural"><span class="hs-identifier hs-type">quotNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-121"></span><span id="quotNatural"><span class="annot"><span class="annottext">quotNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#quotNatural"><span class="hs-identifier hs-var hs-var">quotNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalQuot"><span class="hs-identifier hs-var">N.naturalQuot</span></a></span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-comment">-- | Compute greatest common divisor.</span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.Natural.html#gcdNatural"><span class="hs-identifier hs-type">gcdNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-125"></span><span id="gcdNatural"><span class="annot"><span class="annottext">gcdNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#gcdNatural"><span class="hs-identifier hs-var hs-var">gcdNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalGcd"><span class="hs-identifier hs-var">N.naturalGcd</span></a></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- | Compute least common multiple.</span><span>
</span><span id="line-128"></span><span class="annot"><a href="GHC.Natural.html#lcmNatural"><span class="hs-identifier hs-type">lcmNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-129"></span><span id="lcmNatural"><span class="annot"><span class="annottext">lcmNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#lcmNatural"><span class="hs-identifier hs-var hs-var">lcmNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalLcm"><span class="hs-identifier hs-var">N.naturalLcm</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="annot"><a href="GHC.Natural.html#andNatural"><span class="hs-identifier hs-type">andNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-132"></span><span id="andNatural"><span class="annot"><span class="annottext">andNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#andNatural"><span class="hs-identifier hs-var hs-var">andNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalAnd"><span class="hs-identifier hs-var">N.naturalAnd</span></a></span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="annot"><a href="GHC.Natural.html#orNatural"><span class="hs-identifier hs-type">orNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-135"></span><span id="orNatural"><span class="annot"><span class="annottext">orNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#orNatural"><span class="hs-identifier hs-var hs-var">orNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalOr"><span class="hs-identifier hs-var">N.naturalOr</span></a></span><span>
</span><span id="line-136"></span><span>
</span><span id="line-137"></span><span class="annot"><a href="GHC.Natural.html#xorNatural"><span class="hs-identifier hs-type">xorNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-138"></span><span id="xorNatural"><span class="annot"><span class="annottext">xorNatural :: Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#xorNatural"><span class="hs-identifier hs-var hs-var">xorNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalXor"><span class="hs-identifier hs-var">N.naturalXor</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="annot"><a href="GHC.Natural.html#bitNatural"><span class="hs-identifier hs-type">bitNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Int%23"><span class="hs-identifier hs-type">Int#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-141"></span><span id="bitNatural"><span class="annot"><span class="annottext">bitNatural :: Int# -&gt; Natural
</span><a href="GHC.Natural.html#bitNatural"><span class="hs-identifier hs-var hs-var">bitNatural</span></a></span></span><span> </span><span id="local-6989586621679480740"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480740"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word# -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalBit%23"><span class="hs-identifier hs-var">N.naturalBit#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Word#
</span><a href="../../ghc-prim/src/GHC.Prim.html#int2Word%23"><span class="hs-identifier hs-var">int2Word#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679480740"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="annot"><a href="GHC.Natural.html#testBitNatural"><span class="hs-identifier hs-type">testBitNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-144"></span><span id="testBitNatural"><span class="annot"><span class="annottext">testBitNatural :: Natural -&gt; Int -&gt; Bool
</span><a href="GHC.Natural.html#testBitNatural"><span class="hs-identifier hs-var hs-var">testBitNatural</span></a></span></span><span> </span><span id="local-6989586621679480739"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480739"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679480738"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480738"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Word -&gt; Bool
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalTestBit"><span class="hs-identifier hs-var">N.naturalTestBit</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480739"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word
</span><a href="GHC.Natural.html#int2Word"><span class="hs-identifier hs-var">int2Word</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480738"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="annot"><a href="GHC.Natural.html#popCountNatural"><span class="hs-identifier hs-type">popCountNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-147"></span><span id="popCountNatural"><span class="annot"><span class="annottext">popCountNatural :: Natural -&gt; Int
</span><a href="GHC.Natural.html#popCountNatural"><span class="hs-identifier hs-var hs-var">popCountNatural</span></a></span></span><span> </span><span id="local-6989586621679480736"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480736"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Int
</span><a href="GHC.Natural.html#word2Int"><span class="hs-identifier hs-var">word2Int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Natural -&gt; Word
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalPopCount"><span class="hs-identifier hs-var">N.naturalPopCount</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480736"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="annot"><a href="GHC.Natural.html#shiftLNatural"><span class="hs-identifier hs-type">shiftLNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-150"></span><span id="shiftLNatural"><span class="annot"><span class="annottext">shiftLNatural :: Natural -&gt; Int -&gt; Natural
</span><a href="GHC.Natural.html#shiftLNatural"><span class="hs-identifier hs-var hs-var">shiftLNatural</span></a></span></span><span> </span><span id="local-6989586621679480734"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480734"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679480733"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480733"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Word -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalShiftL"><span class="hs-identifier hs-var">N.naturalShiftL</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480734"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word
</span><a href="GHC.Natural.html#int2Word"><span class="hs-identifier hs-var">int2Word</span></a></span><span>  </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480733"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.Natural.html#shiftRNatural"><span class="hs-identifier hs-type">shiftRNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-153"></span><span id="shiftRNatural"><span class="annot"><span class="annottext">shiftRNatural :: Natural -&gt; Int -&gt; Natural
</span><a href="GHC.Natural.html#shiftRNatural"><span class="hs-identifier hs-var hs-var">shiftRNatural</span></a></span></span><span> </span><span id="local-6989586621679480731"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480731"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679480730"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480730"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Word -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalShiftR"><span class="hs-identifier hs-var">N.naturalShiftR</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480731"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word
</span><a href="GHC.Natural.html#int2Word"><span class="hs-identifier hs-var">int2Word</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679480730"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-comment">-- | @since 4.12.0.0</span><span>
</span><span id="line-156"></span><span class="annot"><a href="GHC.Natural.html#naturalToInteger"><span class="hs-identifier hs-type">naturalToInteger</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span>
</span><span id="line-157"></span><span id="naturalToInteger"><span class="annot"><span class="annottext">naturalToInteger :: Natural -&gt; Integer
</span><a href="GHC.Natural.html#naturalToInteger"><span class="hs-identifier hs-var hs-var">naturalToInteger</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Integer
</span><a href="../../ghc-bignum/src/GHC.Num.Integer.html#integerFromNatural"><span class="hs-identifier hs-var">I.integerFromNatural</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="annot"><a href="GHC.Natural.html#naturalToWord"><span class="hs-identifier hs-type">naturalToWord</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span>
</span><span id="line-160"></span><span id="naturalToWord"><span class="annot"><span class="annottext">naturalToWord :: Natural -&gt; Word
</span><a href="GHC.Natural.html#naturalToWord"><span class="hs-identifier hs-var hs-var">naturalToWord</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Word
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalToWord"><span class="hs-identifier hs-var">N.naturalToWord</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- | @since 4.10.0.0</span><span>
</span><span id="line-163"></span><span class="annot"><a href="GHC.Natural.html#naturalFromInteger"><span class="hs-identifier hs-type">naturalFromInteger</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Integer.html#Integer"><span class="hs-identifier hs-type">Integer</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-164"></span><span id="naturalFromInteger"><span class="annot"><span class="annottext">naturalFromInteger :: Integer -&gt; Natural
</span><a href="GHC.Natural.html#naturalFromInteger"><span class="hs-identifier hs-var hs-var">naturalFromInteger</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Integer.html#integerToNatural"><span class="hs-identifier hs-var">I.integerToNatural</span></a></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | Construct 'Natural' from 'Word' value.</span><span>
</span><span id="line-167"></span><span class="hs-comment">--</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-169"></span><span class="annot"><a href="GHC.Natural.html#wordToNatural"><span class="hs-identifier hs-type">wordToNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-170"></span><span id="wordToNatural"><span class="annot"><span class="annottext">wordToNatural :: Word -&gt; Natural
</span><a href="GHC.Natural.html#wordToNatural"><span class="hs-identifier hs-var hs-var">wordToNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalFromWord"><span class="hs-identifier hs-var">N.naturalFromWord</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="hs-comment">-- | Try downcasting 'Natural' to 'Word' value.</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- Returns 'Nothing' if value doesn't fit in 'Word'.</span><span>
</span><span id="line-174"></span><span class="hs-comment">--</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-176"></span><span class="annot"><a href="GHC.Natural.html#naturalToWordMaybe"><span class="hs-identifier hs-type">naturalToWordMaybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span>
</span><span id="line-177"></span><span id="naturalToWordMaybe"><span class="annot"><span class="annottext">naturalToWordMaybe :: Natural -&gt; Maybe Word
</span><a href="GHC.Natural.html#naturalToWordMaybe"><span class="hs-identifier hs-var hs-var">naturalToWordMaybe</span></a></span></span><span> </span><span id="local-6989586621679480726"><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480726"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; (# (# #) | Word# #)
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalToWordMaybe%23"><span class="hs-identifier hs-var">N.naturalToWordMaybe#</span></a></span><span> </span><span class="annot"><span class="annottext">Natural
</span><a href="#local-6989586621679480726"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-178"></span><span>   </span><span class="hs-special">(#</span><span>       </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679480724"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480724"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Maybe Word
forall a. a -&gt; Maybe a
</span><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Word
</span><a href="../../ghc-prim/src/GHC.Types.html#W%23"><span class="hs-identifier hs-var">W#</span></a></span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679480724"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-179"></span><span>   </span><span class="hs-special">(#</span><span> </span><span class="hs-special">(#</span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">|</span><span>   </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Word
forall a. Maybe a
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="annot"><a href="GHC.Natural.html#wordToNatural%23"><span class="hs-identifier hs-type">wordToNatural#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Word"><span class="hs-identifier hs-type">Word</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-182"></span><span id="wordToNatural%23"><span class="annot"><span class="annottext">wordToNatural# :: Word -&gt; Natural
</span><a href="GHC.Natural.html#wordToNatural%23"><span class="hs-identifier hs-var hs-var">wordToNatural#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalFromWord"><span class="hs-identifier hs-var">N.naturalFromWord</span></a></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="hs-comment">-- | \&quot;@'powModNatural' /b/ /e/ /m/@\&quot; computes base @/b/@ raised to</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- exponent @/e/@ modulo @/m/@.</span><span>
</span><span id="line-186"></span><span class="hs-comment">--</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- @since 4.8.0.0</span><span>
</span><span id="line-188"></span><span class="annot"><a href="GHC.Natural.html#powModNatural"><span class="hs-identifier hs-type">powModNatural</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-bignum/src/GHC.Num.Natural.html#Natural"><span class="hs-identifier hs-type">Natural</span></a></span><span>
</span><span id="line-189"></span><span id="powModNatural"><span class="annot"><span class="annottext">powModNatural :: Natural -&gt; Natural -&gt; Natural -&gt; Natural
</span><a href="GHC.Natural.html#powModNatural"><span class="hs-identifier hs-var hs-var">powModNatural</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Natural -&gt; Natural -&gt; Natural -&gt; Natural
</span><a href="../../ghc-bignum/src/GHC.Num.Natural.html#naturalPowMod"><span class="hs-identifier hs-var">N.naturalPowMod</span></a></span><span>
</span><span id="line-190"></span></pre></body></html>